@using Akso.MultiTenancy
<div>
    <form name="tenantEditForm" role="form" novalidate class="form-validation">
        <div class="modal-header">
            <h4 class="modal-title">
                <span>@L("EditTenant"): {{vm.tenant.tenancyName}}</span>
            </h4>
        </div>
        <div class="modal-body">

            <div class="form-group form-md-line-input form-md-floating-label no-hint">
                <input type="text" name="Name" class="form-control input-ltr" ng-class="{'edited':vm.tenant.name}" ng-model="vm.tenant.name" required maxlength="@Tenant.MaxNameLength">
                <label>@L("Name")</label>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label no-hint" ng-if="vm.currentConnectionString">
                <input type="text" name="ConnectionString" class="form-control edited" ng-model="vm.tenant.connectionString" required maxlength="@Tenant.MaxConnectionStringLength">
                <label>@L("DatabaseConnectionString")</label>
            </div>

            <div ng-if="vm.currentConnectionString">
                <span class="help-block text-warning">@L("TenantDatabaseConnectionStringChangeWarningMessage")</span>
            </div>

            <div class="form-group form-md-line-input form-md-floating-label has-info">
                <select id="TenantEditionSelectionCombobox" class="form-control" ng-class="{'edited':vm.tenant.editionId != null}" ng-options="vm.getEditionValue(item) as item.displayText for item in vm.editions" ng-model="vm.tenant.editionId"></select>
                <label for="TenantEditionSelectionCombobox">@L("Edition")</label>
            </div>

            <div class="md-checkbox-list">
                <div class="md-checkbox">
                    <input id="EditTenant_IsActive" class="md-check" type="checkbox" name="IsActive" ng-model="vm.tenant.isActive">
                    <label for="EditTenant_IsActive">
                        <span class="inc"></span>
                        <span class="check"></span>
                        <span class="box"></span>
                        @L("Active")
                    </label>
                </div>
            </div>

        </div>
        <div class="modal-footer">
            <button type="button" ng-disabled="vm.saving" class="btn btn-default" ng-click="vm.cancel()">@L("Cancel")</button>
            <button type="submit" button-busy="vm.saving" busy-text="@L("SavingWithThreeDot")" class="btn btn-primary blue" ng-click="vm.save()" ng-disabled="tenantEditForm.$invalid"><i class="fa fa-save"></i> <span>@L("Save")</span></button>
        </div>
    </form>
</div>